home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / ExtUtils / MM_Win32.pm < prev    next >
Encoding:
Perl POD Document  |  1999-12-28  |  18.4 KB  |  741 lines

  1. package ExtUtils::MM_Win32;
  2.  
  3. =head1 NAME
  4.  
  5. ExtUtils::MM_Win32 - methods to override UN*X behaviour in ExtUtils::MakeMaker
  6.  
  7. =head1 SYNOPSIS
  8.  
  9.  use ExtUtils::MM_Win32; # Done internally by ExtUtils::MakeMaker if needed
  10.  
  11. =head1 DESCRIPTION
  12.  
  13. See ExtUtils::MM_Unix for a documentation of the methods provided
  14. there. This package overrides the implementation of these methods, not
  15. the semantics.
  16.  
  17. =over
  18.  
  19. =cut 
  20.  
  21. use Config;
  22. use File::Basename;
  23. require Exporter;
  24.  
  25. Exporter::import('ExtUtils::MakeMaker',
  26.        qw( $Verbose &neatvalue));
  27.  
  28. $ENV{EMXSHELL} = 'sh'; # to run `commands`
  29. unshift @MM::ISA, 'ExtUtils::MM_Win32';
  30.  
  31. $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
  32. $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
  33. $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
  34.  
  35. sub dlsyms {
  36.     my($self,%attribs) = @_;
  37.  
  38.     my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
  39.     my($vars)  = $attribs{DL_VARS} || $self->{DL_VARS} || [];
  40.     my($imports)  = $attribs{IMPORTS} || $self->{IMPORTS} || {};
  41.     my(@m);
  42.     (my $boot = $self->{NAME}) =~ s/:/_/g;
  43.  
  44.     if (not $self->{SKIPHASH}{'dynamic'}) {
  45.     push(@m,"
  46. $self->{BASEEXT}.def: Makefile.PL
  47. ",
  48.      q!    $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
  49.      -e "Mksymlists('NAME' => '!, $self->{NAME},
  50.      q!', 'DLBASE' => '!,$self->{DLBASE},
  51.      q!', 'DL_FUNCS' => !,neatvalue($funcs),
  52.      q!, 'IMPORTS' => !,neatvalue($imports),
  53.      q!, 'DL_VARS' => !, neatvalue($vars), q!);"
  54. !);
  55.     }
  56.     join('',@m);
  57. }
  58.  
  59. sub replace_manpage_separator {
  60.     my($self,$man) = @_;
  61.     $man =~ s,/+,.,g;
  62.     $man;
  63. }
  64.  
  65. sub maybe_command {
  66.     my($self,$file) = @_;
  67.     return "$file.exe" if -e "$file.exe";
  68.     return;
  69. }
  70.  
  71. sub file_name_is_absolute {
  72.     my($self,$file) = @_;
  73.     $file =~ m{^([a-z]:)?[\\/]}i ;
  74. }
  75.  
  76. sub find_perl {
  77.     my($self, $ver, $names, $dirs, $trace) = @_;
  78.     my($name, $dir);
  79.     if ($trace >= 2){
  80.     print "Looking for perl $ver by these names:
  81. @$names
  82. in these dirs:
  83. @$dirs
  84. ";
  85.     }
  86.     foreach $dir (@$dirs){
  87.     next unless defined $dir; # $self->{PERL_SRC} may be undefined
  88.     foreach $name (@$names){
  89.         my ($abs, $val);
  90.         if ($self->file_name_is_absolute($name)) { # /foo/bar
  91.         $abs = $name;
  92.         } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # foo
  93.         $abs = $self->catfile($dir, $name);
  94.         } else { # foo/bar
  95.         $abs = $self->canonpath($self->catfile($self->curdir, $name));
  96.         }
  97.         print "Checking $abs\n" if ($trace >= 2);
  98.         next unless $self->maybe_command($abs);
  99.         print "Executing $abs\n" if ($trace >= 2);
  100.         $val = `$abs -e "require $ver;" 2>&1`;
  101.         if ($? == 0) {
  102.             print "Using PERL=$abs\n" if $trace;
  103.             return $abs;
  104.         } elsif ($trace >= 2) {
  105.         print "Result: `$val'\n";
  106.         }
  107.     }
  108.     }
  109.     print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
  110.     0; # false and not empty
  111. }
  112.  
  113. sub catdir {
  114.     my $self = shift;
  115.     my @args = @_;
  116.     for (@args) {
  117.     $_ .= "\\" if $_ eq '' or substr($_,-1) ne "\\";
  118.     }
  119.     my $result = $self->canonpath(join('', @args));
  120.     $result;
  121. }
  122.  
  123. =item catfile
  124.  
  125. Concatenate one or more directory names and a filename to form a
  126. complete path ending with a filename
  127.  
  128. =cut
  129.  
  130. sub catfile {
  131.     my $self = shift @_;
  132.     my $file = pop @_;
  133.     return $file unless @_;
  134.     my $dir = $self->catdir(@_);
  135.     $dir =~ s/(\\\.)$//;
  136.     $dir .= "\\" unless substr($dir,length($dir)-1,1) eq "\\";
  137.     return $dir.$file;
  138. }
  139.  
  140. sub init_others
  141. {
  142.  my ($self) = @_;
  143.  &ExtUtils::MM_Unix::init_others;
  144.  $self->{'TOUCH'}  = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
  145.  $self->{'CHMOD'}  = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod'; 
  146.  $self->{'CP'}     = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
  147.  $self->{'RM_F'}   = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
  148.  $self->{'RM_RF'}  = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
  149.  $self->{'MV'}     = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
  150.  $self->{'NOOP'}   = 'rem';
  151.  $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
  152.  $self->{'LD'}     = $Config{'ld'} || 'link';
  153.  $self->{'AR'}     = $Config{'ar'} || 'lib';
  154.  $self->{'LDLOADLIBS'}
  155.     ||= ( $BORLAND
  156.           ? 'import32.lib cw32mti.lib '
  157.           : 'msvcrt.lib oldnames.lib kernel32.lib comdlg32.lib winspool.lib gdi32.lib '
  158.         .'advapi32.lib user32.lib shell32.lib netapi32.lib ole32.lib '
  159.         .'oleaut32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib '
  160.     ) . ' odbc32.lib odbccp32.lib';
  161.  $self->{'DEV_NULL'} = '> NUL';
  162. }
  163.  
  164.  
  165. =item constants (o)
  166.  
  167. Initializes lots of constants and .SUFFIXES and .PHONY
  168.  
  169. =cut
  170.  
  171. sub constants {
  172.     my($self) = @_;
  173.     my(@m,$tmp);
  174.  
  175.     for $tmp (qw/
  176.  
  177.           AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
  178.           VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
  179.           INST_ARCHLIB INST_SCRIPT PREFIX  INSTALLDIRS
  180.           INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
  181.           INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
  182.           PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
  183.           FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
  184.           PERL_INC PERL FULLPERL
  185.  
  186.           / ) {
  187.     next unless defined $self->{$tmp};
  188.     push @m, "$tmp = $self->{$tmp}\n";
  189.     }
  190.  
  191.     push @m, qq{
  192. VERSION_MACRO = VERSION
  193. DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
  194. XS_VERSION_MACRO = XS_VERSION
  195. XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
  196. };
  197.  
  198.     push @m, qq{
  199. MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
  200. MM_VERSION = $ExtUtils::MakeMaker::VERSION
  201. };
  202.  
  203.     push @m, q{
  204. };
  205.  
  206.     for $tmp (qw/
  207.           FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
  208.           LDFROM LINKTYPE
  209.           /    ) {
  210.     next unless defined $self->{$tmp};
  211.     push @m, "$tmp = $self->{$tmp}\n";
  212.     }
  213.  
  214.     push @m, "
  215. XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
  216. C_FILES = ".join(" \\\n\t", @{$self->{C}})."
  217. O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
  218. H_FILES = ".join(" \\\n\t", @{$self->{H}})."
  219. MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
  220. MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
  221. ";
  222.  
  223.     for $tmp (qw/
  224.           INST_MAN1DIR INSTALLMAN1DIR MAN1EXT INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
  225.           /) {
  226.     next unless defined $self->{$tmp};
  227.     push @m, "$tmp = $self->{$tmp}\n";
  228.     }
  229.  
  230.     push @m, qq{
  231. .USESHELL :
  232. } if $DMAKE;
  233.  
  234.     push @m, q{
  235. .NO_CONFIG_REC: Makefile
  236. } if $ENV{CLEARCASE_ROOT};
  237.  
  238.     push @m, qq{
  239. makemakerdflt: all
  240.  
  241. .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
  242.  
  243.  
  244. .PHONY: all config static dynamic test linkext manifest
  245.  
  246. CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
  247. };
  248.  
  249.     my @parentdir = split(/::/, $self->{PARENT_NAME});
  250.     push @m, q{
  251. INST_LIBDIR      = }. $self->catdir('$(INST_LIB)',@parentdir)        .q{
  252. INST_ARCHLIBDIR  = }. $self->catdir('$(INST_ARCHLIB)',@parentdir)    .q{
  253.  
  254. INST_AUTODIR     = }. $self->catdir('$(INST_LIB)','auto','$(FULLEXT)')       .q{
  255. INST_ARCHAUTODIR = }. $self->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)')   .q{
  256. };
  257.  
  258.     if ($self->has_link_code()) {
  259.     push @m, '
  260. INST_STATIC  = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
  261. INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
  262. INST_BOOT    = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
  263. ';
  264.     } else {
  265.     push @m, '
  266. INST_STATIC  =
  267. INST_DYNAMIC =
  268. INST_BOOT    =
  269. ';
  270.     }
  271.  
  272.     $tmp = $self->export_list;
  273.     push @m, "
  274. EXPORT_LIST = $tmp
  275. ";
  276.     $tmp = $self->perl_archive;
  277.     push @m, "
  278. PERL_ARCHIVE = $tmp
  279. ";
  280.  
  281.  
  282.     push @m, q{
  283. TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
  284.  
  285. PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
  286. };
  287.  
  288.     join('',@m);
  289. }
  290.  
  291.  
  292. sub path {
  293.     local $^W = 1;
  294.     my($self) = @_;
  295.     my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
  296.     my @path = split(';',$path);
  297.     foreach(@path) { $_ = '.' if $_ eq '' }
  298.     @path;
  299. }
  300.  
  301. =item static_lib (o)
  302.  
  303. Defines how to produce the *.a (or equivalent) files.
  304.  
  305. =cut
  306.  
  307. sub static_lib {
  308.     my($self) = @_;
  309.  
  310.     return '' unless $self->has_link_code;
  311.  
  312.     my(@m);
  313.     push(@m, <<'END');
  314. $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
  315.     $(RM_RF) $@
  316. END
  317.     push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
  318.  
  319.     push @m,
  320. q{    $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")' : '-out:$@ $(OBJECT)').q{
  321.     }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
  322.     $(CHMOD) 755 $@
  323. };
  324.  
  325.  
  326.     push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
  327.     if $self->{PERL_SRC};
  328.  
  329.     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  330.     join('', "\n",@m);
  331. }
  332.  
  333. =item dynamic_bs (o)
  334.  
  335. Defines targets for bootstrap files.
  336.  
  337. =cut
  338.  
  339. sub dynamic_bs {
  340.     my($self, %attribs) = @_;
  341.     return '
  342. BOOTSTRAP =
  343. ' unless $self->has_link_code();
  344.  
  345.     return '
  346. BOOTSTRAP = '."$self->{BASEEXT}.bs".'
  347.  
  348. $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
  349.     '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
  350.     '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
  351.         -MExtUtils::Mkbootstrap \
  352.         -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
  353.     '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
  354.     $(CHMOD) 644 $@
  355.  
  356. $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
  357.     '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
  358.     -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
  359.     $(CHMOD) 644 $@
  360. ';
  361. }
  362.  
  363. =item dynamic_lib (o)
  364.  
  365. Defines how to produce the *.so (or equivalent) files.
  366.  
  367. =cut
  368.  
  369. sub dynamic_lib {
  370.     my($self, %attribs) = @_;
  371.     return '' unless $self->needs_linking(); #might be because of a subdir
  372.  
  373.     return '' unless $self->has_link_code;
  374.  
  375.     my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
  376.     my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
  377.     my($ldfrom) = '$(LDFROM)';
  378.     my(@m);
  379.     push(@m,'
  380. OTHERLDFLAGS = '.$otherldflags.'
  381. INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
  382.  
  383. $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
  384. ');
  385.  
  386.     push(@m, $BORLAND ?
  387. q{    $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) $(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,),$(RESFILES)} :
  388. q{    $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)}
  389.     );
  390.     push @m, '
  391.     $(CHMOD) 755 $@
  392. ';
  393.  
  394.     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  395.     join('',@m);
  396. }
  397.  
  398. sub perl_archive
  399. {
  400.  return '$(PERL_INC)\perl$(LIB_EXT)';
  401. }
  402.  
  403. sub export_list
  404. {
  405.  my ($self) = @_;
  406.  return "$self->{BASEEXT}.def";
  407. }
  408.  
  409. =item canonpath
  410.  
  411. No physical check on the filesystem, but a logical cleanup of a
  412. path. On UNIX eliminated successive slashes and successive "/.".
  413.  
  414. =cut
  415.  
  416. sub canonpath {
  417.     my($self,$path) = @_;
  418.     $path =~ s/^([a-z]:)/\u$1/;
  419.     $path =~ s|/|\\|g;
  420.     $path =~ s|(.)\\+|$1\\|g ;                     # xx////xx  -> xx/xx
  421.     $path =~ s|(\\\.)+\\|\\|g ;                    # xx/././xx -> xx/xx
  422.     $path =~ s|^(\.\\)+|| unless $path eq ".\\";   # ./xx      -> xx
  423.     $path =~ s|\\$|| 
  424.              unless $path =~ m#^([a-z]:)?\\#;      # xx/       -> xx
  425.     $path .= '.' if $path =~ m#\\$#;
  426.     $path;
  427. }
  428.  
  429. =item perl_script
  430.  
  431. Takes one argument, a file name, and returns the file name, if the
  432. argument is likely to be a perl script. On MM_Unix this is true for
  433. any ordinary, readable file.
  434.  
  435. =cut
  436.  
  437. sub perl_script {
  438.     my($self,$file) = @_;
  439.     return "$file.pl" if -r "$file.pl" && -f _;
  440.     return;
  441. }
  442.  
  443. =item pm_to_blib
  444.  
  445. Defines target that copies all files in the hash PM to their
  446. destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
  447.  
  448. =cut
  449.  
  450. sub pm_to_blib {
  451.     my $self = shift;
  452.     my($autodir) = $self->catdir('$(INST_LIB)','auto');
  453.     return q{
  454. pm_to_blib: $(TO_INST_PM)
  455.     }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
  456.     "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
  457.         -e "pm_to_blib(qw[ }.
  458.     ($NMAKE ? '<<pmfiles.dat'
  459.         : '$(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n)').
  460.     q{ ],'}.$autodir.q{')"
  461.     }. ($NMAKE ? q{
  462. $(PM_TO_BLIB)
  463. <<
  464.     } : '') . $self->{NOECHO}.q{$(TOUCH) $@
  465. };
  466. }
  467.  
  468. =item test_via_harness (o)
  469.  
  470. Helper method to write the test targets
  471.  
  472. =cut
  473.  
  474. sub test_via_harness {
  475.     my($self, $perl, $tests) = @_;
  476.     "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
  477. }
  478.  
  479.  
  480. =item tool_autosplit (override)
  481.  
  482. Use Win32 quoting on command line.
  483.  
  484. =cut
  485.  
  486. sub tool_autosplit{
  487.     my($self, %attribs) = @_;
  488.     my($asl) = "";
  489.     $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  490.     q{
  491. AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
  492. };
  493. }
  494.  
  495. =item tools_other (o)
  496.  
  497. Win32 overrides.
  498.  
  499. Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
  500. the Makefile. Also defines the perl programs MKPATH,
  501. WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
  502.  
  503. =cut
  504.  
  505. sub tools_other {
  506.     my($self) = shift;
  507.     my @m;
  508.     my $bin_sh = $Config{sh} || 'cmd /c';
  509.     push @m, qq{
  510. SHELL = $bin_sh
  511. } unless $DMAKE;  # dmake determines its own shell 
  512.  
  513.     for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
  514.     push @m, "$_ = $self->{$_}\n";
  515.     }
  516.  
  517.     push @m, q{
  518. MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
  519.  
  520. EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
  521. };
  522.  
  523.  
  524.     return join "", @m if $self->{PARENT};
  525.  
  526.     push @m, q{
  527. WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
  528. -e "print 'WARNING: I have found an old package in';" \\
  529. -e "print '    ', $$ARGV[0], '.';" \\
  530. -e "print 'Please make sure the two installations are not conflicting';"
  531.  
  532. UNINST=0
  533. VERBINST=1
  534.  
  535. MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
  536. -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
  537.  
  538. DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
  539. -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
  540. -e "print '=over 4';" \
  541. -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
  542. -e "print '=back';"
  543.  
  544. UNINSTALL =   $(PERL) -MExtUtils::Install \
  545. -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
  546. -e "print \" packlist above carefully.\n  There may be errors. Remove the\";" \
  547. -e "print \" appropriate files manually.\n  Sorry for the inconveniences.\n\""
  548. };
  549.  
  550.     return join "", @m;
  551. }
  552.  
  553. =item xs_o (o)
  554.  
  555. Defines suffix rules to go from XS to object files directly. This is
  556. only intended for broken make implementations.
  557.  
  558. =cut
  559.  
  560. sub xs_o {    # many makes are too dumb to use xs_c then c_o
  561.     my($self) = shift;
  562.     return ''
  563. }
  564.  
  565. =item top_targets (o)
  566.  
  567. Defines the targets all, subdirs, config, and O_FILES
  568.  
  569. =cut
  570.  
  571. sub top_targets {
  572.  
  573.     my($self) = shift;
  574.     my(@m);
  575.     push @m, '
  576. ';
  577.  
  578.     push @m, '
  579. all :: pure_all manifypods
  580.     '.$self->{NOECHO}.'$(NOOP)
  581.       unless $self->{SKIPHASH}{'all'};
  582.     
  583.     push @m, '
  584. pure_all :: config pm_to_blib subdirs linkext
  585.     '.$self->{NOECHO}.'$(NOOP)
  586.  
  587. subdirs :: $(MYEXTLIB)
  588.     '.$self->{NOECHO}.'$(NOOP)
  589.  
  590. config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
  591.     '.$self->{NOECHO}.'$(NOOP)
  592.  
  593. config :: $(INST_ARCHAUTODIR)\.exists
  594.     '.$self->{NOECHO}.'$(NOOP)
  595.  
  596. config :: $(INST_AUTODIR)\.exists
  597.     '.$self->{NOECHO}.'$(NOOP)
  598. ';
  599.  
  600.     push @m, qq{
  601. config :: Version_check
  602.     $self->{NOECHO}\$(NOOP)
  603.  
  604. } unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
  605.  
  606.     push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
  607.  
  608.     if (%{$self->{MAN1PODS}}) {
  609.     push @m, qq[
  610. config :: \$(INST_MAN1DIR)\\.exists
  611.     $self->{NOECHO}\$(NOOP)
  612.  
  613. ];
  614.     push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
  615.     }
  616.     if (%{$self->{MAN3PODS}}) {
  617.     push @m, qq[
  618. config :: \$(INST_MAN3DIR)\\.exists
  619.     $self->{NOECHO}\$(NOOP)
  620.  
  621. ];
  622.     push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
  623.     }
  624.  
  625.     push @m, '
  626. $(O_FILES): $(H_FILES)
  627. ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
  628.  
  629.     push @m, q{
  630. help:
  631.     perldoc ExtUtils::MakeMaker
  632. };
  633.  
  634.     push @m, q{
  635. Version_check:
  636.     }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
  637.         -MExtUtils::MakeMaker=Version_check \
  638.         -e "Version_check('$(MM_VERSION)')"
  639. };
  640.  
  641.     join('',@m);
  642. }
  643.  
  644. =item manifypods (o)
  645.  
  646. We don't want manpage process.  XXX add pod2html support later.
  647.  
  648. =cut
  649.  
  650. sub manifypods {
  651.     return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
  652. }
  653.  
  654. =item dist_ci (o)
  655.  
  656. Same as MM_Unix version (changes command-line quoting).
  657.  
  658. =cut
  659.  
  660. sub dist_ci {
  661.     my($self) = shift;
  662.     my @m;
  663.     push @m, q{
  664. ci :
  665.     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
  666.         -e "@all = keys %{ maniread() };" \\
  667.         -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
  668.         -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
  669. };
  670.     join "", @m;
  671. }
  672.  
  673. =item dist_core (o)
  674.  
  675. Same as MM_Unix version (changes command-line quoting).
  676.  
  677. =cut
  678.  
  679. sub dist_core {
  680.     my($self) = shift;
  681.     my @m;
  682.     push @m, q{
  683. dist : $(DIST_DEFAULT)
  684.     }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
  685.         -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
  686.  
  687. tardist : $(DISTVNAME).tar$(SUFFIX)
  688.  
  689. zipdist : $(DISTVNAME).zip
  690.  
  691. $(DISTVNAME).tar$(SUFFIX) : distdir
  692.     $(PREOP)
  693.     $(TO_UNIX)
  694.     $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
  695.     $(RM_RF) $(DISTVNAME)
  696.     $(COMPRESS) $(DISTVNAME).tar
  697.     $(POSTOP)
  698.  
  699. $(DISTVNAME).zip : distdir
  700.     $(PREOP)
  701.     $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
  702.     $(RM_RF) $(DISTVNAME)
  703.     $(POSTOP)
  704.  
  705. uutardist : $(DISTVNAME).tar$(SUFFIX)
  706.     uuencode $(DISTVNAME).tar$(SUFFIX) \\
  707.         $(DISTVNAME).tar$(SUFFIX) > \\
  708.         $(DISTVNAME).tar$(SUFFIX)_uu
  709.  
  710. shdist : distdir
  711.     $(PREOP)
  712.     $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
  713.     $(RM_RF) $(DISTVNAME)
  714.     $(POSTOP)
  715. };
  716.     join "", @m;
  717. }
  718.  
  719. =item pasthru (o)
  720.  
  721. Defines the string that is passed to recursive make calls in
  722. subdirectories.
  723.  
  724. =cut
  725.  
  726. sub pasthru {
  727.     my($self) = shift;
  728.     return "PASTHRU = " . ($NMAKE ? "-nologo" : "");
  729. }
  730.  
  731.  
  732.  
  733. 1;
  734. __END__
  735.  
  736. =back
  737.  
  738. =cut 
  739.  
  740.